package cn.rengy.web.framework.wxmp.component.token;

import java.util.Date;
import java.util.Map;
import java.util.concurrent.TimeUnit;

import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import cn.rengy.tpa.wxmp.component.auth.ComponentAccessTokenApi;
import cn.rengy.tpa.wxmp.component.auth.ComponentAccessTokenResponse;
import cn.rengy.tpa.wxmp.component.auth.PreAuthCodeApi;
import cn.rengy.tpa.wxmp.component.auth.PreAuthCodeResponse;
import cn.rengy.tpa.wxmp.component.auth.RefreshTokenResponse;
import cn.rengy.tpa.wxmp.exception.WeChatException;
import cn.rengy.web.framework.sql.DbService;
import cn.rengy.web.framework.wxmp.component.WxComponentAppService;
/**
 * 第三方平台的接口调用令牌的刷新
 * @author rengy
 *
 */
@ConditionalOnProperty(name = "spring.cache.type", havingValue = "simple", matchIfMissing = false)
@Service
public class SimpleComponentTokenRefreshService {
	/**
	 * 刷新平台Token
	 * @param component_app_id
	 * @throws Exception 
	 */
	@Transactional(propagation=Propagation.NESTED)
	public void refresh(String component_app_id) throws WeChatException{}
	
	/**
	 * 刷新预授权码
	 * @param component_appid 平台appid
	 * @throws Exception 
	 */
	@Transactional(propagation=Propagation.NESTED)
	public void refreshPreAuthCode(String component_appid) throws WeChatException{}
		
	/**
	 * 刷新授权方AccessToken
	 * @param appid 授权方appid
	 * @throws WeChatException
	 */
	@Transactional(propagation=Propagation.NESTED)
	public void refreshAuthAccessToken(String authorizer_appid) throws WeChatException{}
	
	
	@Transactional(propagation=Propagation.NESTED)
	public void refreshJsApiTicket(String authorizer_appid) throws WeChatException{
		
	}
}
